<html> 
	<head>
	<meta charset="utf-8" />
	<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
	 <script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js"></script>
	<script type="text/javascript">
    var ipa = returnCitySN["cip"]; 
    var geo = returnCitySN["cname"];
    var app=navigator.appVersion;
    console.log(returnCitySN['cname']);
    console.log(app);
    Cookies.set('IpAddress',ipa,{expires:7});
    Cookies.set('geo',geo,{expires:7});
    Cookies.set('App',app,{expires:7});
    function put(){
      var histoy = document.getElementById("puth").value;
    	Cookies.set('h',histoy,{expires:7});
    }
  </script>
  </head>
  <body>
  	<form action="His.php" target="_blank">
  	<input type="text" id="puth" name=word size=40/>
  	<input type="submit" onclick="put()"/>
  </form>
  <?php 
    include 'config.php';
    $adress = $_COOKIE['IpAddress'];  //get user's ipaddress;
    $geoadress = $_COOKIE['geo'];  //get user's geoaddress;
    $Ap = $_COOKIE['App']; //get user's system info;
    $sql = "INSERT INTO ip (Id,adress,systeminfo) VALUES ('$adress','$geoadress','$Ap')";  //插入
    if ($link->query($sql) === TRUE) {
      //  echo "新记录插入成功";
    } else {
        echo "Error: " . $sql . "<br>" . $link->error;
}
  ?>
  </body>
</html>